package com.spring.boot.test.config.stragegy;


import com.spring.boot.test.utils.StrUtils;

public abstract class HashCodeFieldShardStrategy implements FieldShardStrategy{
    abstract int getShardNum();

    @Override
    public String getShardSuffix(String shardingValue) {
        return StrUtils.tail2(StrUtils.getAbsModuloValue(shardingValue.hashCode(), this.getShardNum()));
    }
}
